Pandas 中map, applymap and apply的区别 您所在的位置:网站首页 pandasDataFrameapply Pandas 中map, applymap and apply的区别

Pandas 中map, applymap and apply的区别

2022-05-26 03:07| 来源: 网络整理| 查看: 265

Python中@staticmethod和@classmethod的区别和用法

xk-wang: 这个区别解释的不合理,你把代码改成下面的两个还是没区别。[code=python] # -*- coding: utf-8 -*- class Parent(object): @staticmethod def staticSayHello(anything): if anything == Boy: print("Boy classSayHello") elif anything == Girl: print("girl sayHello") @classmethod def classSayHello(anything): #这里是anything if anything == Boy: print("Boy classSayHello") elif anything == Girl: print("girl sayHello") class Boy(Parent): pass class Girl(Parent): pass if __name__ == '__main__': Boy.classSayHello() Girl.classSayHello() [/code]



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有